<?php


namespace App\Http\Controllers\Api\Repositories;

use App\Models\WxFeedback as Model;
use App\Wen\Utils\UserUtils;

class WxFeedbackRepositories
{
    /**
     * 添加
     * @param [$uid,$feedback_type,$feedback_content]
     * @return bool
     */
    public static function add($uid, $feedback_type, $feedback_content, $imgs, $contact)
    {

        $feedbackModel = new Model();

        $feedbackModel->user_id = $uid;
        $feedbackModel->feedback_type = $feedback_type;
        $feedbackModel->feedback_content = $feedback_content;
        $feedbackModel->feedback_imgs = implode(',', $imgs);
        $feedbackModel->feedback_contact = $contact || '';
        $feedbackModel->feedback_state = 0;
        $feedbackModel->is_solve = 0;
        $r = $feedbackModel->save();
        if($r){
            UserUtils::assistant_notice('admin', '有新的用户反馈待回复');
        }
        return $r;

    }

}
